<template>
    <div>
        <van-sticky offset-top="46px">
            <el-tabs v-model="activeName" style="background: #fffbfb">
                <el-tab-pane label="设备状态" name="first"></el-tab-pane>
                <el-tab-pane label="产线节拍" name="second"></el-tab-pane>
            </el-tabs>
        </van-sticky>

        <router-view v-if="activeName === 'first'"></router-view>
        <div v-if="activeName === 'second'">
            <tabs-2></tabs-2>
        </div>
    </div>
</template>

<script>
import linecharts from './Linecharts'
import Tabs2 from './Tabs2.vue'

export default {
    components: {linecharts, Tabs2},
    // eslint-disable-next-line vue/multi-word-component-names
    name: "Tabs",
    data() {
        return {
            activeName: 'first',
        }
    },
    watch: {
        activeName(newV){
            if(newV === 'first') this.$router.push('/facility/facistate/cards')
        }
    },

    mounted() {
        this.$router.push('/facility/facistate/cards')
    },
}
</script>

<style scoped>
::v-deep .el-tabs__nav-scroll {
    width: 51%;
    justify-content: center;
    margin: 0 auto
}

</style>
